home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1995 March / Macworld CD-ROM (March 1995).cdr / Updaters / AppMaker 1.5.2->1.5.4 / Libraries / THINK / AMClassLibC / CGrayLine.cp < prev    next >
Encoding:
Text File  |  1991-11-24  |  1.5 KB  |  66 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  CGrayLine.c
  3.  
  4.                             The GrayLine Class
  5.         
  6.         A Pane containing an Gray Line, drawn from the topLeft to the
  7.         bottomRight of the frame.
  8.     
  9.     SUPERCLASS = CPane.c
  10.  
  11.     Copyright © 1991 Bowers Development Corporation. All rights reserved.
  12.     
  13.  ******************************************************************************/
  14.  
  15. #include <Global.h>
  16. #include <Constants.h>
  17. #include <TBUtilities.h>
  18. #include "CGrayLine.h"
  19.  
  20.  
  21. /******************************************************************************
  22.  IGrayLine
  23.  
  24.         Initialize a GrayLine object.  Just calls inherited method.
  25.  ******************************************************************************/
  26.  
  27. void    CGrayLine::IGrayLine (
  28.     CView            *anEnclosure,
  29.     CBureaucrat        *aSupervisor,
  30.     short            aWidth,
  31.     short            aHeight,
  32.     short            aHEncl,
  33.     short            aVEncl,
  34.     SizingOption    aHSizing,
  35.     SizingOption    aVSizing)
  36. {
  37.  
  38.     CPane::IPane (anEnclosure, aSupervisor, aWidth, aHeight,
  39.                     aHEncl, aVEncl, aHSizing, aVSizing);
  40. } /* IGrayLine */
  41.     
  42.  
  43. /******************************************************************************
  44.  Draw
  45.  
  46.         Draw a GrayLine
  47.  ******************************************************************************/
  48.  
  49. void    CGrayLine::Draw (
  50.     Rect        *area)
  51. {
  52.     Rect        theFrame;
  53.     PenState    savePen;
  54.  
  55.     GetPenState (&savePen);
  56.     PenNormal ();
  57.     FrameToQDR (&frame, &theFrame);
  58.     PenPat (gray);
  59.     MoveTo (frame.left, frame.top);
  60.     LineTo (frame.right - 1, frame.bottom - 1);
  61.     SetPenState (&savePen);
  62.  
  63. } /* Draw */
  64.     
  65.  
  66.